/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package crawler;

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import db.MySQLDataManager;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.text.ParseException;

import java.util.Date;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.*;
/**
*
* @author vimal
*/
import java.util.StringTokenizer;
import java.util.logging.Level;
import java.util.logging.Logger;
public class Main {

    /**
    * @param args the command line arguments
    */

public static String removeSpaces(String s) {
  StringTokenizer st = new StringTokenizer(s," ",false);
  String t="";
  while (st.hasMoreElements()) t += st.nextElement();
  return t;
}

 /* remove leading whitespace */
public static String ltrim(String source) {
    return source.replaceAll("^\\s+", "");
}

public static String reverseIt(String source) {
    int i, len = source.length();
    StringBuilder dest = new StringBuilder(len);

    for (i = (len - 1); i >= 0; i--)
      dest.append(source.charAt(i));
    return dest.toString();
  }

public static boolean chechTime(int hour, int minute, int second)
{
        boolean check = false;

        Date date = new Date();   // given date
        Calendar calendar = GregorianCalendar.getInstance(); // creates a new calendar instance
        calendar.setTime(date);   // assigns calendar to given date
        calendar.get(Calendar.HOUR_OF_DAY); // gets hour in 24h format
        calendar.get(calendar.MINUTE);
        calendar.get(calendar.SECOND);
       //calendar.get(calendar.SECOND);
        System.out.println(calendar.get(calendar.MINUTE));
        System.out.println(calendar.get(Calendar.HOUR_OF_DAY));
        System.out.println(calendar.get(calendar.SECOND));
        if ((calendar.get(Calendar.HOUR_OF_DAY) == hour)&&(calendar.get(calendar.MINUTE) == minute)&&(calendar.get(calendar.SECOND)== second))
        {
            check = true;
        }
        return check;
}

public static void main(String[] args) {
        // test.getResult();
        //TestThread test1 = new TestThread();
        //getResultFrom_xoso88 result = new getResultFrom_xoso88();
        try {
            getResultFrom_xoso88.processData();
        } catch (ParseException ex) {
            Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}
